#include "exti.h"
#include "STC89C5xRC.H"
#include "ir1838.h"
#include "task.h"

void exti0_isr() interrupt 0
{
#if IR1838_TASK
    /* handle ir1838 exti start */
    ir1838_exti_handle();
    /* handle ir1838 exti end */
#endif
}

void exti0_init(exti_type_t exti_type)
{
    IT0 = exti_type; /* set INT0 interrupt type(1:Falling   0:Low level) */
    EX0 = 1;         /* enable INT0 interrupt */
    EA = 1;          /* open global interrupt switch */
}